package org.fireking.myapplication.drawing

import android.graphics.Canvas
import android.graphics.Paint
import com.github.mikephil.charting.utils.Transformer
import org.fireking.myapplication.ChartDrawingRenderer

/**
 * 图形绘制策略接口 - 用于抽离不同图形的绘制逻辑
 */
interface ShapeDrawingStrategy {
    /**
     * 绘制图形
     */
    fun draw(canvas: Canvas, transformer: Transformer?, paint: Paint)

    /**
     * 检查点是否在图形上或附近
     */
    fun containsPoint(x: Float, y: Float, touchTolerance: Float = 20f): Boolean

    /**
     * 检查点是否在图形内部
     */
    fun containsPointInside(x: Float, y: Float, edgeTolerance: Float = 10f): Boolean

    /**
     * 获取控制点列表
     */
    fun getControlPoints(): List<ChartDrawingRenderer.ControlPoint>

    /**
     * 应用控制点移动
     */
    fun applyControlPointMove(controlPointId: Int, deltaX: Float, deltaY: Float)

    /**
     * 移动整个图形
     */
    fun move(deltaX: Float, deltaY: Float)
}